package fanzone;

import java.io.File;
import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

public class LocalResourceInfo implements ResourceInfo, Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	String path;
	String filename;
	boolean islocal;
	List<String> urls;

	public LocalResourceInfo(File f, boolean islocal) {
		this.path = f.getAbsolutePath();
		this.filename = f.getName();
		this.islocal = islocal;
		urls = new ArrayList<String>();
		urls.add( "file:" + path);
	}
	
	// constructor for remote urls
	public LocalResourceInfo(URL url, boolean islocal)
	{
		this.path = url.toExternalForm();
		this.filename = url.getFile();
		this.islocal = islocal;
		this.urls = new ArrayList<String>();
		urls.add(this.path);
	}

	public String getName() {
		return filename;
	}
	
	public boolean isLocal() {
		return islocal;
	}

	public List<String> getURL() {
		return urls;
	}
	public String getID() {
		return path;
	}

	@Override
	public String getHTTPURL() {
		return null;
	}
}
